const int max_dep = 6;
const int qua = 4;
const int shade_sample = 64;
const int drefl_sample = 16;

vec ori( -0.25 , -0.4 , 1 ) , x_axis , y_axis( 0.4 , 1 , -0.7 ) , z_axis;
double wid_x = 0.5 , wid_z = 0.5;

void build_world() {
	//area light
	obj[tot].type = "rectange";
	obj[tot].light = true;
	obj[tot].ver = 4;
	obj[tot].P[0] = vec( 0.3 , 1.2 , 0.8 );
	obj[tot].P[1] = vec( 0.6 , 1.2 , 0.8 );
	obj[tot].P[2] = vec( 0.6 , 1.5 , 0.8 );
	obj[tot].P[3] = vec( 0.3 , 1.5 , 0.8 );
	obj[tot].completion();
	obj[tot].color = col( 1 , 1 , 1 );
	tot++;

	//floor
	obj[tot].type = "plane";
	obj[tot].N = vec( 0 , 0 , 1 );
	obj[tot].radius = 0;
	obj[tot].material( 0.6 , 0 , 0.2 , 0.2 );
	obj[tot].texture = true;
	obj[tot].u_scale = obj[tot].v_scale = 0.6;
	obj[tot].N.caln_2D_axis( obj[tot].u_axis , obj[tot].v_axis );
	image_scan( "floor_board.bmp" , obj[tot].tex = tex_tot++ );
	tot++;

	//sphere
	obj[tot].type = "sphere";
	obj[tot].O = vec( 0.5 , 1 , 0.2 );
	obj[tot].radius = 0.2;
	//obj[tot].rindex = 1;
	obj[tot].material( 0.3 , 0.7 , 0 , 0.3 );
	obj[tot].rindex = 1.05;
	//obj[tot].material( 0.25 , 1 , 0.2 , 0.05 );
	obj[tot].color = col( 1 , 1 , 1 );
	tot++;

	//sphere
	obj[tot].type = "sphere";
	obj[tot].O = vec( 0 , 1 , 0.2 );
	obj[tot].radius = 0.2;
	obj[tot].material( 0.75 , 0 , 0.2 , 0.05  );
	obj[tot].color = col( 0 , 1 , 1 );
	tot++;

	//sphere
	obj[tot].type = "sphere";
	obj[tot].O = vec( 0.4 , 1.7 , 0.2 );
	obj[tot].radius = 0.2;
	obj[tot].material( 0.75 , 0 , 0.2 , 0.05 );
	obj[tot].color = col( 1 , 0 , 1 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( -5 , -5 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( -5 , 5 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( 5 , -5 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( 5 , 5 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( -5 , 0 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( 0 , 5 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( 5 , 0 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;

	//point light
	obj[tot].type = "sphere";
	obj[tot].light = true;
	obj[tot].O = vec( 0 , 5 , 1 );
	obj[tot].color = col( 0.3 , 0.3 , 0.3 );
	tot++;
}
